<template>
    <div>
        <div class="sc-list">
            <ul>
                <li style="display:flex;flex-wrap: wrap" v-for="item in list" :key="item.value" @click="toDetails(item.siteId)">
                    <div style="flex:0 0 95%;font-weight:900">
                        {{item.siteName}}
                    </div>
                    <div style="flex:0 0 5%">
                        <i class="iconfont icon-jiantou-copy" style="color:#409eff;"></i>
                    </div>
                    <div style="flex:0 0 100%;font-size:.875rem">
                        监控数量：{{item.num}}
                    </div>
                </li>
            </ul>
        </div>
    </div>
</template>

<script>
import utils from '@/utils'
import {
  getUserInfo,
  setUserInfo,
  logout
} from '@/utils/auth'
export default {
    data(){
        return{
            list:[]
        }
    },
    created(){
        setUserInfo(utils.getQueryString('token'))
        console.log(utils.getQueryString('token'))
    },
    mounted(){
        this.getList()
    },
    methods:{
        toDetails(siteId) {
            this.$router.push({ path: '/detail', query: { siteId: siteId } })
        },
        getList(){
            this.$api.video.waterpum().then(res => {
                if (res.success) {
                    this.list=res.data.list
                }
            });
        }
    }
}
</script>

<style>

</style>
